﻿@ModelType SistemaINCA.Models.ViewModels.NotasPeriodosGradoModel
@code
    Dim calWidth As Integer = 150 + 135 + (35 * Model.listPeriodos.Count)
    Dim nsufi, npfinal As String
End Code
<table class="tbl-pnl-left tbl-hover tbl-data-alumno" style="border-collapse: collapse; margin: 0 auto; font-size: 12px; width: @calWidth">
    <thead>
        <tr>
            <td class="sys-thead sys-thead-topleft" style="width: 150px;">Materia</td>
            @For Each p In Model.listPeriodos
                @<td class="sys-thead" title="@p.TITULO" style="width: 35px;">@p.PERIODO</td>
            Next
            <td class="sys-thead" title="Promedio" style="width: 45px;">Prom</td>
            <td class="sys-thead" title="Examen de Recuperación" style="width: 45px;">Exam Recup.</td>
            <td class="sys-thead sys-thead-topright" title="Promedio Final del Año" style="width: 45px;">Prom Final</td>
        </tr>
    </thead>
    <tbody class="tbl-color-alt tbody-border">
        @For Each Mat In Model.NotasPeriodos
            nsufi = IIf(Mat.Promedio < 6, Mat.ExaSufi, "N/A")
            npfinal = IIf(Mat.Promedio < 6, If(String.IsNullOrWhiteSpace(Mat.ExaSufi), Mat.Promedio, Math.Round((CDec(Mat.Promedio) + CDec(Mat.ExaSufi)) / 2.0, 0).ToString("#0.0")), Mat.Promedio)
            @<tr>
                <td class="cell-notas-tits" data-id-mat="@Mat.ID_Materia">@Mat.Materia</td>
            @For i = 0 To Mat.Periodos.Count - 1
                @<td class="cell-notas-nota" data-nota="@Mat.Periodos(i).Nota">@Mat.Periodos(i).Nota</td>        
            Next
                <td class="cell-notas-nota cell-notas-prom" data-nota="@Mat.Promedio">@Mat.Promedio</td>
                <td class="cell-notas-nota cell-notas-exsufi" data-nota="@nsufi">@nsufi</td>
                <td class="cell-notas-nota cell-notas-promfinal" data-nota="@npfinal">@npfinal</td>
            </tr>
        Next
    </tbody>
</table>
